﻿#pragma once

#include "svgshape.h"

#include <functional>
#include <gsl/span>

// 将矩形的四边都向外扩展 size 大小
QRectF EnlargeRect(QRectF rect, double size);

// 主要就是保证，创建矩形的两个点是 左上角点 和 右下角点
QRectF CreateRectF(const QPointF& p0, const QPointF& p1);

using PainterInitFun = std::function<void(QPainter&)>;
void ParallelPaint(gsl::span<SvgShape*> shapes, QPixmap& target, const PainterInitFun& painterInit);

void ParallelPaint(gsl::span<unique_ptr<SvgShape>> shapes, QPixmap& target, const PainterInitFun& painterInit);

void ParallelPaint(gsl::span<QRectF> shapes, QPixmap& target, const PainterInitFun& painterInit);
